package hoang.hut.networkdemo.network.json;

import hoang.hut.networkdemo.network.WebServiceConfig;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

/**
 * 
 * @author Hoangnv
 * 
 * day la lop de tao ra cac tham so de truyen len Server
 */

public class ParameterFactory {

	public static List<NameValuePair> createParamsLocList(String tokenID,
			String action, String toll_road, String loc_id) {

		List<NameValuePair> parameters = new ArrayList<NameValuePair>();

		parameters.add(new BasicNameValuePair(WebServiceConfig.PARAM_TOKEN_ID,
				tokenID));
		parameters.add(new BasicNameValuePair(WebServiceConfig.PARAM_ACTION,
				action));
		parameters.add(new BasicNameValuePair(WebServiceConfig.PARAM_TOLL_ROAD,
				toll_road));
		parameters.add(new BasicNameValuePair(WebServiceConfig.PARAM_LOC_ID,
				loc_id));
		parameters.add(new BasicNameValuePair(
				WebServiceConfig.PARAM_TIME_STAMP, getTimeStamp()));

		return parameters;
	}
	
	public static String getTimeStamp(){
		Date date = new Date();
		return String.valueOf(date.getTime());
	}

}
